package com.chance.cc.crawler.development.command.trigger.domain.douyin;

import com.chance.cc.crawler.core.downloader.HttpPage;
import com.chance.cc.crawler.development.command.job.domain.douyin.DouyinSearchPhoneCrawlerScheduleJob;
import com.chance.cc.crawler.development.command.trigger.CrawlerJobTriggerCommand;
import com.chance.cc.crawler.meta.core.bean.CrawlerMetaConstant;

import static com.chance.cc.crawler.development.command.publish.douyin.DYPublishCrawlerJob.metaServerIP;
import static com.chance.cc.crawler.development.command.publish.douyin.DYPublishCrawlerJob.metaServerPort;

/**
 * @author bx
 * @date 2020/12/7 0007 11:15
 */
public class DYSearchPhoneScheduleTrigger {

    private static final String domainId = "douyin";

    private static final String crawlerKey = DouyinSearchPhoneCrawlerScheduleJob.crawlerKey;
    private static final String tringgerKey = "douyin_search-phone-realtime-cron";

    private static CrawlerJobTriggerCommand crawlerJobTriggerCommand =
            new CrawlerJobTriggerCommand(metaServerIP,metaServerPort);

    public static void main(String[] args) {
        publishDYSearchScheduleTriggerInfo();
    }


    public static void publishDYSearchScheduleTriggerInfo(){
        HttpPage page = crawlerJobTriggerCommand.addOrUpdateScheduleCrawlerTrigger(
                crawlerKey,
                tringgerKey,
                domainId,
                CrawlerMetaConstant.ScheduleJobTrigger_Simple,
                "0 10 0 * * ?",
                "抖音手机关键词搜索任务每天00：10执行");

//        HttpPage page = crawlerJobTriggerCommand.addOrUpdateScheduleCrawlerTrigger(
//                crawlerKey,
//                tringgerKey,
//                domainId,
//                CrawlerMetaConstant.ScheduleJobTrigger_Simple,
//                "",
//                "抖音搜索手机单次任务调度");
        System.out.println("添加手机调度： "+page.getRawText());
    }
}
